import java.util.ArrayList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: hp
 * Date: 2024-03-26
 * Time: 23:09
 */
public class Test3 {
    public static void main(String[] args) {
        String str1 = "welcome to bit";
        String str2 = "come";
        StringBuilder stringBuffer = new StringBuilder();
        for(int i = 0; i < str1.length(); i++) {
            char ch = str1.charAt(i);
            if (!str2.contains(ch + "")) {
                stringBuffer.append(ch);
            }
        }
        System.out.println(stringBuffer);
    }

    public static void main7(String[] args) {
        List<Character> List1 = new ArrayList<>();
        String str1 = "welcome to bit";
        String str2 = "come";
        for(int i = 0; i < str1.length(); i++) {
            int flag = 1;
            for (int j = 0; j < str2.length(); j++) {
                if(str1.charAt(i) == str2.charAt(j)) {
                    flag = 0;
                    break;
                }
            }
            if(flag == 1) {
                List1.add(str1.charAt(i));
            }
        }

        for(char s : List1) {
            System.out.print(s);
        }

        //System.out.println(List1);

    }

}
